package com.zy.ioc.pro3_ioc_componentscan;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @program: mavenTest153
 * @description:
 * @author: zy
 * @create: 2025-07-12 16:44
 */
public class AppTest {
    public static void main(String[] args) {
        ApplicationContext ac= new AnnotationConfigApplicationContext(AppConfig.class);

//        AccountDao ad= (AccountDao) ac.getBean("accountDao");
//        AccountService as= (AccountService) ac.getBean("accountService");
//        Item item= (Item) ac.getBean("item");
//
//        System.out.println(ad);
//        System.out.println(as);
//        System.out.println(item);

       String[] beanNames= ac.getBeanDefinitionNames();  //
        for(  String s:beanNames ){
            System.out.println(s);
        }
    }
}
